﻿using HelperFromTheSkeleton.Model.RequestModels;
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.Filters;

namespace HelperFromTheSkeleton.APICore.Filters
{
    /// <summary>
    /// API核心库Exception拦截器
    /// </summary>
    public class APICoreExceptionFilter : IExceptionFilter
    {
        public void OnException(ExceptionContext context)
        {
            context.Result = new JsonResult(ResultModel.Fall(context.Exception));
        }
    }
}